import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkYueJuUserVO, SkYueJuUserForm, SkYueJuUserQuery } from '@/api/app/SkYueJuUser/types';

/**
 * 查询约局用户信息列表
 * @param query
 * @returns {*}
 */

export const listSkYueJuUser = (query?: SkYueJuUserQuery): AxiosPromise<SkYueJuUserVO[]> => {
  return request({
    url: '/app/SkYueJuUser/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询约局用户信息详细
 * @param id
 */
export const getSkYueJuUser = (id: string | number): AxiosPromise<SkYueJuUserVO> => {
  return request({
    url: '/app/SkYueJuUser/' + id,
    method: 'get'
  });
};

/**
 * 新增约局用户信息
 * @param data
 */
export const addSkYueJuUser = (data: SkYueJuUserForm) => {
  return request({
    url: '/app/SkYueJuUser',
    method: 'post',
    data: data
  });
};

/**
 * 修改约局用户信息
 * @param data
 */
export const updateSkYueJuUser = (data: SkYueJuUserForm) => {
  return request({
    url: '/app/SkYueJuUser',
    method: 'put',
    data: data
  });
};

/**
 * 删除约局用户信息
 * @param id
 */
export const delSkYueJuUser = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkYueJuUser/' + id,
    method: 'delete'
  });
};
